package com.irs.irsforum.service;

import com.baomidou.mybatisplus.service.IService;
import com.irs.irsforum.entity.Message;

import java.sql.SQLException;
import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author yihuili
 * @since 2020-02-12
 */
public interface IMessageService extends IService<Message> {
    /**
     * 得到消息列表
     * @param userId
     * @return
     */
    List<Message> getMessageList(Long userId);

    /**
     * 设置为已读
     * @param userId
     * @param messageId
     * @return
     */
    Integer setRead(Long userId, Long messageId);

    /**
     * 删除message，即设置isExist = 0
     * @param userId
     * @param messageId
     * @return
     */
    Integer delMessage(Long userId, Long messageId);


    /**
     * 发送推荐消息
     * @param message
     * @param problemId
     * @param subjectId
     * @return
     */
    Integer writeRecommendMessage(Message message, Long problemId, Long subjectId) throws SQLException ;
}
